//
//  NSString+LBAlert.m
//  LBAlert
//
//  Created by LINAICAI on 2017/8/13.
//  Copyright © 2017年 LINAICAI. All rights reserved.
//

#import "NSString+LBAlert.h"

@implementation NSString (LBAlert)
+ (CGFloat)getTextHeightWithText:(NSString *)text
                            Font:(UIFont *)font
                           Width:(CGFloat)width {
    
    NSDictionary *attributes = @{
                                 NSFontAttributeName: font,
                                 };
    CGRect expectedLabelRect = [text boundingRectWithSize:(CGSize){width, CGFLOAT_MAX}
                                                  options:NSStringDrawingUsesLineFragmentOrigin
                                               attributes:attributes
                                                  context:nil];
    return CGRectGetHeight(expectedLabelRect);
    
}
@end
